#!/usr/bin/python3
# _*_ coding: utf-8 _*_
#
# Copyright (C) 2024 - 2024 heihieyouheihei, Inc. All Rights Reserved 
#
# @Time    : 2024/9/26 16:57
# @Author  : Yuyun
# @File    : practice_02.py
# @IDE     : PyCharm
"""
用代码查找 任意字母和数字组成的字符串中，隐藏的最大数字
如：
"ashdkjashd1239712412dkfahsk324"

"""
import re
s = input()
pattern = '\d+'
num = re.findall(pattern, s)
print(max(map(int, num)))
